-- GENERATED SPELL FOR [Undercity Mage] --


function spell0_18971(pUnit, Event) --@Blizzard,n/a--
pUnit:FullCastSpellOnTarget(33624,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18971', 12000, 1)
end

function spell1_18971(pUnit, Event) --@Fireball,n/a--
pUnit:FullCastSpellOnTarget(33417,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18971', 3000, 1)
end

function spell2_18971(pUnit, Event) --@Icebolt,n/a--
pUnit:FullCastSpellOnTarget(33463,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18971', 520, 1)
end

function Sorts_18971(pUnit, Event)
local choix_sorts_18971 = math.random(0, 2)
if choix_sorts_18971 == 0 then
pUnit:RegisterEvent('spell0_18971', 1, 1)
end
if choix_sorts_18971 == 1 then
pUnit:RegisterEvent('spell1_18971', 1, 1)
end
if choix_sorts_18971 == 2 then
pUnit:RegisterEvent('spell2_18971', 1, 1)
end
end

function mob18971_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_18971', math.random(1500, 3000), 1)
end

function mob18971_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18971_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18971_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(18971, 1, 'mob18971_Action')
RegisterUnitEvent(18971, 2, 'mob18971_Leave')
RegisterUnitEvent(18971, 3, 'mob18971_Kill')
RegisterUnitEvent(18971, 4, 'mob18971_Die')
